<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<script type="text/javascript" src="../Public/js/jquery.js"></script>
<script type="text/javascript" src="../Public/js/My97DatePicker/WdatePicker.js"></script>

<style>
.guoqi{color:#f00;}
.n3{color:#f0f;}
.n7{color:#0f0;}
span{margin:10px;}
</style>
<script>
now = '<?php echo ($now); ?>';
d = 60*60*24;
$().ready(function(){
	$('.date').each(function(data){
		times = $(this).attr('date');
		st = times - now
		if(st <0)
			{
			$(this).addClass('guoqi');
			}
		else if(st >=0 && st < d*3)
			{
			$(this).addClass('n3');
			}
		else if(st >= d*3 && st<d*7)
			{
			$(this).addClass('n7');
			}
		
		
	})
	
	
	
})


function edit(id)
{
	window.location.href="<?php echo ($editurl); ?>/id/"+id;	
	
}
function del(id)
{
	if(confirm('此操作会将此记录彻底从系统中删除！并且无法恢复。\n确定继续？'))
		{
			$.post('<?php echo ($delurl); ?>',
			{'id':id},
				function(data){
				eval('data='+data);
				if(data.state == 1)
				{
					window.location.reload();
				}else
				{
					alert(data.msg);
				}
			})
	}
}

</script>
</head>
<body>

<div>

<div class="tit">
<fieldset>
<legend>查询窗口</legend>
<form action="__ACTION__" id="form">
栏目：<select name="class" onchange="$('#form').submit()">
<option value="0">请选择栏目..</option>
<?php if(is_array($class)): $i = 0; $__LIST__ = $class;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$i;$mod = ($i % 2 )?><option value="<?php echo ($vo["id"]); ?>" <?php if(($vo["id"])  ==  $_GET['class']): ?>selected="selected"<?php endif; ?> ><?php echo ($vo["classname"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
</select>
<span>网站名称：<input type="text" name="webname" value="<?php echo $_GET["webname"];?>"/></span>
<span>网址：<input type="text" name="weburl" value="<?php echo $_GET["weburl"];?>" /></span> 
<span>联系方式：<input type="text" name="contact" value="<?php echo $_GET["contact"];?>" /></span>
<span>显示所有信息:<input type="checkbox" name="vlid"  <?php if(($_GET['vlid'])  ==  "on"): ?>checked="checked"<?php endif; ?>/></span>

<p></p>
<span>到期时间:<select name="q_d" onchange="$('#form').submit()"><option value="-1">快速选择到期时间</option>
<option value="0" <?php if(($_GET['q_d'])  ==  "0"): ?>selected="selected"<?php endif; ?>>已经过期</option>
<option value="3" <?php if(($_GET['q_d'])  ==  "3"): ?>selected="selected"<?php endif; ?>>3天内到期</option>
<option value="7" <?php if(($_GET['q_d'])  ==  "7"): ?>selected="selected"<?php endif; ?>>7天内到期</option>
<option value="15" <?php if(($_GET['q_d'])  ==  "15"): ?>selected="selected"<?php endif; ?>>15天内到期</option>
</select><input type="text" name="expiration1" value="<?php echo $_GET["expiration1"];?>" onClick="WdatePicker()" class="Wdate"/> - <input type="text" name="expiration2" value="<?php echo $_GET["expiration2"];?>" onClick="WdatePicker()" class="Wdate" /></span>
<span>客服信息:<input type="text" name="servermsg" value="<?php echo $_GET["servermsg"];?>" /></span>
<span>备注:<input type="text" name="notice" value="<?php echo $_GET["notice"];?>" /></span>
<span><input type="submit" value="查询" /></span><span><input type="button" onclick="window.location.href='__ACTION__'" value="清空" /></span>
</form>
</fieldset><p>
<i>颜色值：
<span class="guoqi">已过期</span> 
<span class="n3">3天过期</span> 
<span class="n7">7天过期</span></i></p>
</div>


<div class="content">
<table border="1" cellspacing="0"><tr><td>id</td><td>栏目名称</td><td>网站名称</td><td>网址</td><td>金额</td><td>联系方式</td><td>到期时间</td><td>客服信息</td><td>备注</td><td>&nbsp;</td><td>操作</td><tr>
<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$i;$mod = ($i % 2 )?><tr><td><?php echo ($vo["id"]); ?></td><td><?php echo ($vo["classname"]); ?></td><td><?php echo ($vo["linkname"]); ?></td><td><?php echo ($vo["linkurl"]); ?></td>
<td><?php echo ($vo["money"]); ?>/月</td><td><?php echo ($vo["contact"]); ?></td><td class="date" date="<?php echo ($vo["expiration"]); ?>"><?php echo (date('Y-m-d',$vo["expiration"])); ?></td><td><?php echo ($vo["servermsg"]); ?></td><td><?php echo ($vo["notice"]); ?></td>
<td><?php if(($vo["vlid"])  ==  "0"): ?>有效<?php else: ?><font color="red">无效</font><?php endif; ?><td><input type="button" onclick="edit('<?php echo ($vo["id"]); ?>')" value="改" /><input type="button" onclick="del('<?php echo ($vo["id"]); ?>')" value="删" /><a href="<?php echo ($renewurl); ?>/id/<?php echo ($vo["id"]); ?>">续</a> <a href="__URL__/moneylist/mid/<?php echo ($vo["id"]); ?>">历史消费</a></td></tr><?php endforeach; endif; else: echo "" ;endif; ?>
</table>
<div class="page"><?php echo ($page); ?></div>
<a href="<?php echo ($addurl); ?>">添加新信息</a>
</div>


</div>



</body>
</html>